package com.exam.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name="exam_stu")
public class ExamStu implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -3731820148277681214L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY,generator = "persistenceGenerator")
	@GenericGenerator(name="persistenceGenerator",strategy = "native")
	@Column(name="exam_stu_id",length=15)
	private long examStuId;
	
	@Column(name="exam_stu_name",length=12,nullable=false)
	private String examStuName;
	
	@Column(name="exam_stu_number",length=12,nullable=false)
	private String examStuNumber;
	
	@Column(name="exam_stu_password",length=50,nullable=false)
	private String examStuPassword;
	
	@Column(name="exam_stu_sex",length=7,nullable=true)
	private String examStuSex;
	
	@Column(name="exam_stu_birthday",nullable=true)
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private Date examStuBrithday;
	
	@Column(name="exam_stu_tel",length=15,nullable=true)
	private String examStuTel;
	
	@Column(name="exam_stu_address",length=25,nullable=true)
	private String examStuAddress;
	
	@Column(name="exam_stu_done",length=5,nullable=true)
	private Integer examStuDone;

	public long getExamStuId() {
		return examStuId;
	}

	public void setExamStuId(long examStuId) {
		this.examStuId = examStuId;
	}

	public String getExamStuName() {
		return examStuName;
	}

	public void setExamStuName(String examStuName) {
		this.examStuName = examStuName;
	}

	public String getExamStuNumber() {
		return examStuNumber;
	}

	public void setExamStuNumber(String examStuNumber) {
		this.examStuNumber = examStuNumber;
	}

	public String getExamStuPassword() {
		return examStuPassword;
	}

	public void setExamStuPassword(String examStuPassword) {
		this.examStuPassword = examStuPassword;
	}

	public String getExamStuSex() {
		return examStuSex;
	}

	public void setExamStuSex(String examStuSex) {
		this.examStuSex = examStuSex;
	}

	public Date getExamStuBrithday() {
		return examStuBrithday;
	}

	public void setExamStuBrithday(Date examStuBrithday) {
		this.examStuBrithday = examStuBrithday;
	}

	public String getExamStuTel() {
		return examStuTel;
	}

	public void setExamStuTel(String examStuTel) {
		this.examStuTel = examStuTel;
	}

	public String getExamStuAddress() {
		return examStuAddress;
	}

	public void setExamStuAddress(String examStuAddress) {
		this.examStuAddress = examStuAddress;
	}

	public int getExamStuDone() {
		return examStuDone;
	}

	public void setExamStuDone(int examStuDone) {
		this.examStuDone = examStuDone;
	}

	public ExamStu(long examStuId, String examStuName, String examStuNumber, String examStuPassword, String examStuSex,
			Date examStuBrithday, String examStuTel, String examStuAddress, Integer examStuDone) {
		super();
		this.examStuId = examStuId;
		this.examStuName = examStuName;
		this.examStuNumber = examStuNumber;
		this.examStuPassword = examStuPassword;
		this.examStuSex = examStuSex;
		this.examStuBrithday = examStuBrithday;
		this.examStuTel = examStuTel;
		this.examStuAddress = examStuAddress;
		this.examStuDone = examStuDone;
	}

	public ExamStu() {
		super();
	}
	
	
}
